package ControlLayer;



import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class TestProduct.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class TestProduct
{
    /**
     * Default constructor for test class TestProduct
     */
    public TestProduct()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

    @Test
    public void createProduct()
    {
        ControlLayer.ProductCtr productC1 = new ControlLayer.ProductCtr();
        productC1.createProduct(123456, 100, "Kost", 100, 50, 200, "123456");
    }

    @Test
    public void findProduct()
    {
        ControlLayer.ProductCtr productC2 = new ControlLayer.ProductCtr();
        productC2.createProduct(123456, 100, "Kost", 100, 75, 150, "123456");
        productC2.findProduct(123456);
    }

    @Test
    public void deleteProduct()
    {
        ControlLayer.ProductCtr productC1 = new ControlLayer.ProductCtr();
        productC1.createProduct(123456, 100, "Kost", 75, 50, 100, "123456");
        productC1.updateProduct(321654, 400, "hamster", 100, 50, 200, "321654");
        productC1.updateProduct(123456, 100, "hamster", 100, 75, 200, "123456");
    }

    @Test
    public void updateProduct()
    {
        ControlLayer.ProductCtr productC1 = new ControlLayer.ProductCtr();
        productC1.createProduct(123456, 200, "hamster", 100, 75, 400, "123456");
        productC1.deleteProduct(123456);
    }
}




